Skip to content

chore: Minor CLI polish.#784

Merged
cpojer merged 1 commit into
mainfrom
cli-updates
Mar 12, 2026
Merged

chore: Minor CLI polish.#784
cpojer merged 1 commit into
mainfrom
cli-updates

Conversation

@cpojer
Copy link
Copy Markdown
Member

@cpojer cpojer commented Mar 12, 2026

Aligns the interactive vp command text with the new text we decided on yesterday + changes the formatting of errors coming from Vite Task:

CleanShot 2026-03-12 at 09 36 11@2x

@cpojer cpojer requested review from branchseer and fengmk2 March 12, 2026 00:44
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 12, 2026

Deploy Preview for viteplus-staging canceled.

Name Link
🔨 Latest commit d2b6ea1
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-staging/deploys/69b20dfb3405e20008ce5abe

@cpojer cpojer merged commit f13cb76 into main Mar 12, 2026
21 checks passed
Copy link
Copy Markdown
Member Author

cpojer commented Mar 12, 2026

Merge activity

@cpojer cpojer deleted the cli-updates branch March 12, 2026 01:11
branchseer added a commit to voidzero-dev/vite-task that referenced this pull request May 19, 2026
## Motivation

The error-chain formatting (`error: <msg>` + `* <source>` lines,
bold-red prefix) used to live in vite-plus at the napi boundary
(voidzero-dev/vite-plus#784). That meant any tweak to error output — or
any test that asserts on it — required building the whole vite-plus napi
binding and running through the JS CLI.

Moving the formatter into vite-task lets us iterate on and snapshot-test
the exact user-visible error output directly with `cargo test`, no
vite-plus build needed. vite-plus can then drop its napi-side formatter
since `Session::main` no longer surfaces errors across the boundary — it
prints them itself and returns only an exit status.

## Changes

- New `vite_task::print_error(&anyhow::Error)` — writes `error:
<top-level>` (bold red on TTY) plus `\n* <source>` for each link in the
chain, mirroring the format vite-plus#784 introduced.
- `Session::main` signature: `anyhow::Result<ExitStatus>` →
`ExitStatus`. It prints errors itself via `print_error` and returns
`FAILURE`; the caller just exits with the status.
- `vt` binary uses `print_error` for `Session::init` errors too, so any
error escaping the CLI uses the same format.
- e2e snapshots updated for the new format (`Error:` → `error:`,
anyhow's `Caused by:\n ...` block → `* ...` lines).

vite-plus is pinned to a vite-task revision and will be updated
separately to drop its napi-layer formatter.

https://claude.ai/code/session_012BLuM9bhiDFBfc8U1CMst8

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants